<pre>
<?php

require_once(dirname(__FILE__)."/../Loader.php");

function __autoload($classname)
{
	return Daedalus_Loader::load($classname);
}



$errorLevel = 0;
$defaults = array(	"Path"=>"../../Project/",
					"Server"=>"localhost",
					"Database"=>"test",
					"Username"=>"root",
					"Password"=>"");


function check($string)
{
	global $errorLevel;
	global $defaults;
	if(!isset($_GET[$string]))
	{
		echo "Variable \"$string\" is not set on GET, please correct and retry.<br/>";
		$errorLevel++;
		return $defaults[$string];
	} else
		return $_GET[$string];
}

$path = check("Path");
$server = check("Server");
$database = check("Database");
$username = check("Username");
$password = check("Password");

if($errorLevel != 0)
{
	echo '<form>';
	echo 'Path: <input type="text" name="Path" Value="'.$path.'" /><br/>';
	echo 'Server: <input type="text" name="Server" Value="'.$server.'" /><br/>';
	echo 'Database: <input type="text" name="Database" Value="'.$database.'" /><br/>';
	echo 'Username: <input type="text" name="Username" Value="'.$username.'" /><br/>';
	echo 'Password: <input type="text" name="Password" Value="'.$password.'" /><br/>';
	echo '<input type="submit" value="Submit" />';
	echo '</form>';	
} else {
	$dbGen = new SchemaGenerator($path,$server,$database,$username,$password);
	$dbGen->debug = true;
	$dbGen->build();
	echo 'Complete.<br/>';
}

?>
</pre>